//
//  ImageTableViewCell.m
//  YiChe
//
//  Created by 蒋杏飞 on 15/8/8.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ImageTableViewCell.h"
#import "ListModel.h"
#import "UIImageView+WebCache.h"

@implementation ImageTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initional];
    }
    return self;
}
- (void)initional
{
    CGFloat width = [UIScreen mainScreen].bounds.size.width / 3;
    
    for (int i = 0; i < 3; i++) {
        UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(i * width, 10, width, 60)];
        image.tag = i + 1;
        image.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:image];
        [image release];
    }
}

- (void)setvaluesWithModel:(ListModel *)model
{
    NSString *imageNames = model.picCover;
    NSArray *array = [imageNames componentsSeparatedByString:@";"];
    
    UIImageView *first = (UIImageView *)[self.contentView viewWithTag:1];
    UIImageView *second = (UIImageView *)[self.contentView viewWithTag:2];
    UIImageView *third = (UIImageView *)[self.contentView viewWithTag:3];
//    
//    UIImage *aImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[array objectAtIndex:0]]]];
    [first sd_setImageWithURL:[NSURL URLWithString:[array objectAtIndex:0]] placeholderImage:nil];
    [second sd_setImageWithURL:[NSURL URLWithString:[array objectAtIndex:1]] placeholderImage:nil];
    [third sd_setImageWithURL:[NSURL URLWithString:[array objectAtIndex:2]] placeholderImage:nil];
    
    
}



@end









